using System;
using System.Collections.Generic;
using System.Text;

using Pampa.CRUD.Core;
using Castle.ActiveRecord;

namespace Demo.Model
{
    [ActiveRecord]
    public class CustomerPhone : AbstractActiveRecord<CustomerPhone>, IIdentifiable
    {
        private int id;
        private string type;
        private string number;
        private Customer customer;

        [PrimaryKey]
        public int ID
        {
            get { return id; }
            set { id = value; }
        }

        [Property]
        public string Type
        {
            get { return type; }
            set { type = value; }
        }

        [Property]
        public string Number
        {
            get { return number; }
            set { number = value; }
        }

        [BelongsTo("CustomerID")]
        public virtual Customer Customer
        {
            get { return customer; }
            set { customer = value; }
        }

        #region IIdentifiable Members

        public string Id
        {
            get { return this.ID.ToString(); }
        }

        public static object ParseId(string strID)
        {
            return int.Parse(strID);
        }

        #endregion
    }
}
